
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                            proto.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                    Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

/* klib.asm */
PUBLIC void	out_byte(u16 port, u8 value);
PUBLIC u8	in_byte(u16 port);
PUBLIC void	disp_str(char * info);
PUBLIC void	disp_color_str(char * info, int color);

/* protect.c */
PUBLIC void	init_prot();
PUBLIC u32	seg2phys(u16 seg);

/* klib.c */
PUBLIC void	delay(int time);

/* kernel.asm */
void restart();

//add task entry
/* main.c */
void TestA();
void TaskA();
void TaskB();
void TaskC();
void TaskD();
void TaskE();
void TaskF();

/* i8259.c */
PUBLIC void put_irq_handler(int irq, irq_handler handler);
PUBLIC void spurious_irq(int irq);

/* clock.c */
PUBLIC void clock_handler(int irq);
PUBLIC void init_clock();

/* keyboard.c */
PUBLIC void init_keyboard();

/* tty.c */
PUBLIC void task_tty();
PUBLIC void in_process(TTY* p_tty, u32 key);

/* console.c */
PUBLIC void out_char(CONSOLE* p_con, char ch);
PUBLIC void scroll_screen(CONSOLE* p_con, int direction);
PUBLIC void clear_screen(TTY* p_tty);
//out char with cus_color
PUBLIC void cus_out_char(CONSOLE* p_con, char ch, int color);


/* 以下是系统调用相关 */
//add sys_call functions
/* proc.c */
PUBLIC  int     sys_get_ticks();        /* sys_call */
PUBLIC void sys_P(SEMAPHORE* sp);
PUBLIC void sys_V(SEMAPHORE* sp);
PUBLIC void sys_disp_str(char* str);
PUBLIC void sys_process_sleep(int milli_seconds);
PUBLIC void init_semaphore(int readnum);
PUBLIC void readA();
PUBLIC void readB();
PUBLIC void readC();
PUBLIC void writeD();
PUBLIC void writeE();

/* syscall.asm */
PUBLIC  void    sys_call();             /* int_handler */
PUBLIC  int     get_ticks();

